package org.skyer.third.gateway.api.enums;


public enum GetOrderDetailEnum {
    AUTHORIZATION_EXPIRED(1,"授权过期,请在网店管理那重新授权。"),

    ORDER_STATUS_HAS_BEEN(2,"订单不属于该店铺或订单状态目前不为待发货，不支持同步。"),

    ERROR_MSG(-1,"该店铺暂时不支持指定订单同步。"),

    UNKNOWN_EXCEPTION(-2,"未知异常。"),

    OK(0,"OK");


    private Integer code;
    private String msg;


    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    GetOrderDetailEnum(Integer code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public  static  String getMsg(Integer id){
        for(GetOrderDetailEnum en:GetOrderDetailEnum.values()){
            if(id.equals(en.getCode())){
                return en.getMsg();
            }
        }
        return  null;
    }
}
